import request, { download } from '@/utils/request'

// 下载
/**
 * 
 * @param {*} data //入参
 * @param {*} filename //下载文件名称以及文件后缀为文件类型
 * @returns 
 */
export function downloadequipment (data, filename) {
  return download(
    '/function/equipment/account/export',
    data,
    filename
  )
}

// 获取设备基值导入模板
export function importEquipmentBaseTemplate (data, filename) {
  return download(
    '/function/equipment/base/importEquipmentBaseTemplate',
    data,
    filename
  )
}

// 导入设备基值导入模板
export function importEquipmentBaseExcel (data) {
  return request({
    // headers: {
    //   //文件上传的类型
    //   'Content-Type': 'multipart/form-data',
    // },
    url: '/function/equipment/base/importEquipmentBaseExcel',
    method: 'post',
    data
  })
}

// 设备基值列表
export function getbaselist (data) {
  return request({
    url: '/function/equipment/base/list',
    method: 'get',
    params: data
  })
}

// 设备基值列表
export function checkUniqeByName (data) {
  return request({
    url: '/function/equipment/base/checkUniqeByName',
    method: 'get',
    params: data
  })
}

// 单位字典列表
export function getdatalist (data) {
  return request({
    url: 'system/dict/data/list',
    method: 'get',
    params: data
  })
}
// 类别列表
export function gettypelist (data) {
  return request({
    url: '/function/equipment/type/list',
    method: 'get',
    params: data
  })
}
// 供应商列表
export function getsupplierlist (data) {
  return request({
    url: '/function/supplier/list',
    method: 'get',
    params: { ...data, status: 0 }
  })
}
// 新增设备基值
export function postequipmentlist (data) {
  return request({
    url: '/function/equipment/base',
    method: 'post',
    data
  })
}
// 修改设备基值
export function putequipmentlist (data) {
  return request({
    url: '/function/equipment/base',
    method: 'put',
    data
  })
}
// 修改状态
export function putchangeStatus (data) {
  return request({
    url: '/function/equipment/base/changeStatus',
    method: 'put',
    data
  })
}
// 设备基值详情
export function getchangebase (data) {
  return request({
    url: '/function/equipment/base/' + data,
    method: 'get',
  })
}
// 新增类别
export function postequipmenttype (data) {
  return request({
    url: '/function/equipment/type',
    method: 'post',
    data
  })
}
// 修改类别
export function putequipmenttype (data) {
  return request({
    url: '/function/equipment/type',
    method: 'put',
    data
  })
}
// 修改状态类别
export function putequipmentTypeChangeStatus (data) {
  return request({
    url: '/function/equipment/type/changeStatus',
    method: 'put',
    data
  })
}
// 设备台账列表
export function getequipmentlist (data) {

  return request({
    url: '/function/equipment/account/list',
    method: 'get',
    params: data
  })
}
// 验收基本信息列表
export function getacceptancelist (data) {
  return request({
    url: '/function/acceptance/base/list',
    method: 'get',
    params: data
  })
}

// 部门列表
export function getsystemlist (data) {
  return request({
    url: '/system/dept/list',
    method: 'get',
    params: data
  })
}
// 用户列表
export function getuserlist (data) {
  return request({
    url: '/system/user/list',
    method: 'get',
    params: data
  })
}
// 位置列表
export function getplacelist (data) {
  return request({
    url: '/function/place/list',
    method: 'get',
    params: data
  })
}
// 设备部分信息列表
export function getpartInfolist (data) {
  return request({
    url: '/function/equipment/account/partInfo/list',
    method: 'get',
    params: data
  })
}
// 设备台账详情（设备台账ID/采购金额显示标志（0显示 1不显示））
export function getpartdiliedlist (data, show) {
  return request({
    url: '/function/equipment/account/' + data + '/' + show,
    method: 'get',
    params: data
  })
}
// 新增设备台账
export function posttequipmentlist (data) {
  return request({
    url: '/function/equipment/account',
    method: 'post',
    data
  })
}
// 修改设备台账
export function puttequipmentlist (data) {
  return request({
    url: '/function/equipment/account',
    method: 'put',
    data
  })
}
//启用设备
export function putaccounttenable (data) {
  return request({
    url: '/function/equipment/account/enable',
    method: 'put',
    data
  })
}
//设备台账验收详情
export function getequipmentacceptanceList (data) {
  return request({
    url: '/function/equipment/account/acceptance/' + data,
    method: 'get',
  })
}

//新增位置
export function postplace (data) {
  return request({
    url: '/function/place',
    method: 'post',
    data
  })
}
//新增位置
export function putUpdateplace (data) {
  return request({
    url: '/function/place',
    method: 'put',
    data
  })
}

//生成设备二维码
export function postqrCodeImglist (data) {
  return request({
    url: '/function/create/qrCodeImg/list',
    method: 'post',
    data
  })
}
//区域列表
export function arealist (data) {
  return request({
    url: '/function/area/list',
    method: 'get',
    params: data
  })
}
//位置详情
export function placelist (data) {
  return request({
    url: 'function/place/' + data,
    method: 'get',
  })
}
//位置所包含的设备列表
export function placeaccountlist (data) {
  return request({
    url: '/function/equipment/account/list/byParams',
    method: 'get',
    params: data
  })
}
//新增区域
export function addarealist (data) {
  return request({
    url: '/function/area',
    method: 'post',
    data
  })
}
//修改区域
export function putUpdatearealist (data) {
  return request({
    url: '/function/area',
    method: 'put',
    data
  })
}
//修改区域NFC信息
export function putUpdateNFC (data) {
  return request({
    url: '/function/area/nfc/info',
    method: 'put',
    data
  })
}
//修改区域NFC信息状态
export function putUpdateNFCstatus (data) {
  return request({
    url: '/function/area/nfc/info',
    method: 'put',
    data
  })
}
//配套配件信息列表
export function getconsumablelist (query) {
  return request({
    url: '/function/storehouse/consumable/list',
    method: 'get',
    params: query
  })
}

//备件更换记录列表
export function getreplaceRecordlist (query) {
  return request({
    url: '/function/equipment/consumable/replaceRecord/list',
    method: 'get',
    params: query
  })
}

//维修记录列表
export function getrepairlist (query) {
  return request({
    url: '/function/repair/list',
    method: 'get',
    params: query
  })
}
//关联计划列表
export function getupkeeplist (query) {
  return request({
    url: '/function/upkeep/plan/list',
    method: 'get',
    params: query
  })
}
//关联标准列表
export function getupkeeplevellist (query) {
  return request({
    url: '/function/upkeep/level/list',
    method: 'get',
    params: query
  })
}
//保养记录列表
export function getupkeeptasklist (query) {
  return request({
    url: '/function/upkeep/task/list',
    method: 'get',
    params: query
  })
}
//调拨记录列表
export function getallocationlist (query) {
  return request({
    url: '/function/allocation/list',
    method: 'get',
    params: query
  })
}
//巡检记录列表
export function getinspectionlist (query) {
  return request({
    url: '/function/inspection/task/equipment/record/list',
    method: 'get',
    params: query
  })
}
//修改位置最后打印时间
export function putplacelastPrintTime (query) {
  return request({
    url: '/function/place/lastPrintTime/' + query,
    method: 'put',
  })
}
//修改区域最后打印时间
export function putarealastPrintTime (query) {
  return request({
    url: '/function/area/lastPrintTime/' + query,
    method: 'put',
  })
}
//修改设备台账最后打印时间
export function putequipmentlastPrintTime (query) {
  return request({
    url: '/function/equipment/account/lastPrintTime/' + query,
    method: 'put',
  })
}
//查询实现动态列记录列表
export function getcolumnslist (query) {
  return request({
    url: '/function/dynamic/column/list',
    method: 'get',
    params: query
  })
}
//新增实现动态列记录
export function Updatecolumns (data) {
  return request({
    url: '/function/dynamic/column',
    method: 'put',
    data: data
  })
}